Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vignette to list some differences between R and Python API #1014

Merged
merged 14 commits into from
Apr 11, 2024

Conversation

etiennebacher
Copy link
Collaborator

@etiennebacher etiennebacher commented Apr 6, 2024

Close #1012

We can add more things later if necessary.

@etiennebacher etiennebacher marked this pull request as ready for review April 10, 2024 11:33
@etiennebacher etiennebacher requested a review from eitsupi April 10, 2024 11:34
vignettes/differences-with-python.Rmd Outdated Show resolved Hide resolved
@etiennebacher etiennebacher requested a review from eitsupi April 10, 2024 17:39
Comment on lines 74 to 87
```r
> hms::hms(56, 34, 12)
12:34:56

> pl$DataFrame(x = hms::hms(56, 34, 12))
shape: (1, 1)
┌─────────┐
│ x │
│ --- │
│ f64 │
╞═════════╡
│ 45296.0 │
└─────────┘
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be in reprex style so that it can be copied and pasted and executed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the reprex style but those chunks are not evaluated every time (that would require us to put hms and geos in Suggests)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course I don't think this needs to be an executable code block for now, but I think hms will need to be included in Suggests at some point. (#919)

Comment on lines 93 to 105
```r
> geos::as_geos_geometry("LINESTRING (0 1, 3 9)")
<geos_geometry[1]>
[1] <LINESTRING (0 1, 3 9)>

> pl$DataFrame(x = geos::as_geos_geometry("LINESTRING (0 1, 3 9)"))
Error: Execution halted with the following contexts
0: In R: in $DataFrame():
0: During function call [pl$DataFrame(x = geos::as_geos_geometry("LINESTRING (0 1, 3 9)"))]
1: When constructing polars literal from Robj
2: Encountered the following error in Rust-Polars:
expected Series
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. (Maybe with tryCatch)

@etiennebacher etiennebacher merged commit 5635610 into main Apr 11, 2024
19 checks passed
@etiennebacher etiennebacher deleted the vignette-diff-python branch April 11, 2024 16:18
@eitsupi
Copy link
Collaborator

eitsupi commented Apr 11, 2024

Maybe altdoc file(s) should be updated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do we have a way to create object and struct with classic R functions?
2 participants